package com.yy.wga.user.feign.api;

import com.yy.wga.common.core.dto.BaseFeignApiReqDTO;
import com.yy.wga.common.core.dto.Result;
import com.yy.wga.user.feign.request.*;
import com.yy.wga.user.feign.response.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户管理
 *
 * @author <a href="mailto:ludezh@dingtalk.com"> ludezh </a>
 * @version 1.0.0   2020/6/5,11:30
 * @since 1.0.0     2020/6/5,11:30
 */
@FeignClient(name = "UserFeign",
        url = "http://127.0.0.1:9100",
        path = "/api/user/v1/")
public interface UserFeign {

    /**
     * 小程序微信code登录，没有用户信息
     *
     * @param request WxAuthCode2SessionReq
     * @return WxAuthCode2SessionResp
     */
    @PostMapping("authCode2Session")
    Result<WxAuthCode2SessionResp> authCode2Session(@Validated @RequestBody WxAuthCode2SessionReq request);

    /**
     * 小程序用户信息授权
     *
     * @param request WxGetUserInfoReq
     * @return WxGetUserInfoResp
     */
    @PostMapping("getWxUserInfo")
    Result<WxGetUserInfoResp> getWxUserInfo(@Validated @RequestBody WxGetUserInfoReq request);

    /**
     * 修改用户信息
     *
     * @param request SaveUserInfoReq
     * @return String
     */
    @PostMapping("saveUserInfo")
    Result<String> saveUserInfo(@Validated @RequestBody SaveUserInfoReq request);

    /**
     * 修改用户地址信息
     *
     * @param request SaveUserAddressReq
     * @return String
     */
    @PostMapping("saveUserAddress")
    Result<String> saveUserAddress(@Validated @RequestBody SaveUserAddressReq request);

    /**
     * 获取用户地址信息
     * @param request BaseFeignApiReqDTO
     * @return UserAddressResp
     */
    @GetMapping("getUserAddress")
    Result<UserAddressResp> getUserAddress(@Validated @RequestBody BaseFeignApiReqDTO request);

    /**
     * 根据经纬度获取用户地址信息
     * @param request UserAddressByLngLatReq
     * @return UserAddressResp
     */
    @GetMapping("getUserAddressByLngLat")
    Result<UserAddressResp> getUserAddressByLngLat(@Validated @RequestBody UserAddressByLngLatReq request);

    /**
     * 退出登录
     *
     * @return Boolean
     */
    @PostMapping("logout")
    Result<Boolean> logout();

    /**
     * 修改手机号-发送原手机号验证码
     *
     * @return String
     */
    @PostMapping("modifyPhone/sendVerifyOldPhoneCode")
    Result<String> sendVerifyOldPhoneCode();

    /**
     * 修改手机号-校验原手机号验证码
     *
     * @param request VerifyOldPhoneCodeReq
     * @return String
     */
    @PostMapping("modifyPhone/verifyOldPhoneCode")
    Result<String> verifyOldPhoneCode(@Validated @RequestBody VerifyOldPhoneCodeReq request);

    /**
     * 发送更换手机号验证码-新原手机号
     *
     * @param request SendModifyPhoneNumberReq
     * @return String
     */
    @PostMapping("sendModifyPhoneCode/newPhone")
    Result<String> sendModifyPhoneCode(@Validated @RequestBody SendModifyPhoneNumberReq request);

    /**
     * 更换手机号
     *
     * @param request ModifyPhoneNumberReq
     * @return String
     */
    @PostMapping("modifyPhoneNumber")
    Result<String> modifyPhoneNumber(@Validated @RequestBody ModifyPhoneNumberReq request);

    /**
     * 保存微信号
     *
     * @param request SaveWxNumReq
     * @return QueryAccountResp
     */
    @PostMapping("saveWxNum")
    Result<QueryAccountResp> saveWxNum(@Validated @RequestBody SaveWxNumReq request);


    /**
     * 查询用户基本信息
     *
     * @return QueryAccountResp
     */
    @PostMapping("queryAccount")
    Result<QueryAccountResp> queryAccount();

    /**
     * 授权手机号
     *
     * @param request WxGetPhoneNumberReq
     * @return WxGetPhoneNumberResp
     */
    @PostMapping("authPhoneNumber")
    Result<WxGetPhoneNumberResp> authPhoneNumber(@Validated @RequestBody WxGetPhoneNumberReq request);

    /**
     * 锁粉
     *
     * @param request LockFansReq
     * @return Boolean
     */
    @PostMapping("lockFans")
    Result<Boolean> authPhoneNumber(@Validated @RequestBody LockFansReq request);

    /**
     * 设置微信号
     *
     * @param request UserWxNumberSetReq
     * @return Boolean
     */
    @PostMapping("setWxNum")
    Result<Boolean> setWxNum(@Validated @RequestBody UserWxNumberSetReq request);

    /**
     * 获取服务商微信号
     *
     * @return UserServerWxNumberGetResp
     */
    @PostMapping("getServerWxNum")
    Result<UserServerWxNumberGetResp> getServerWxNum();

    /**
     * 获取上级信息
     *
     * @return
     */
    @PostMapping("getParentInfo")
    Result<UserParentInfoGetResp> getParentInfo();

    /**
     * 设置获取用户注册并且绑定接口
     *
     * @param request UserRegisterAndBindStatusSetReq
     * @return QueryAccountResp
     */
    @PostMapping("setRegisterBindStatus")
    Result<QueryAccountResp> setRegisterBindStatus(@Validated @RequestBody UserRegisterAndBindStatusSetReq request);

    /**
     * 设置获取用户微信信息
     *
     * @param request UserWechatInfoSetReq
     * @return QueryAccountResp
     */
    @PostMapping("setUserWechatInfo")
    Result<QueryAccountResp> setUserWechatInfo(@Validated @RequestBody UserWechatInfoSetReq request);

    /**
     * 发送验证码
     *
     * @param request SendVerificationCodeReq
     * @return String
     */
    @PostMapping("SendVerificationCode")
    Result<String> sendVerificationCode(@Validated @RequestBody SendVerificationCodeReq request);

    /**
     * 阿里H5支付用户登录
     *
     * @param request AliH5PayLoginReq
     * @return AliH5PayLoginResp
     */
    @PostMapping("aliH5PayLogin")
    Result<AliH5PayLoginResp> aliH5PayLogin(@Validated @RequestBody AliH5PayLoginReq request);
}
